<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

use app\common\model\KingCreditLevel;
use app\common\model\UserLevel;

/**
 * 行为日志控制器
 */
class Log extends AdminBase
{
    
    /**
     * 日志列表
     */
    public function logList()
    {
        
        $this->assign('list', $this->logicLog->getLogList());
        
        return $this->fetch('log_list');
    }
  
    /**
     * 日志删除
     */
    public function logDel($id = 0)
    {
        
        $this->jump($this->logicLog->logDel(['id' => $id]));
    }
  
    /**
     * 日志清空
     */
    public function logClean()
    {
        
        $this->jump($this->logicLog->logDel([DATA_STATUS_NAME => DATA_NORMAL]));
    }

    /**
     * 短信日志
     */
    public function sms_log(){
        $this->assign('list', $this->logicLog->getSmsLogList($this->param));
        $this->assign('param',$this->param);
        return $this->fetch();
    }
    /**
     * 邮件日志
     */
    public function email_log(){
        $this->assign('list', $this->logicLog->getEmailLogList($this->param));
        $this->assign('param',$this->param);
        return $this->fetch();
    }
    /**
     * 封号日志
     */
    public function black_log(){
        $this->assign('list', $this->logicLog->getBlackLogList($this->param));
        $this->assign('param',$this->param);
        return $this->fetch();
    }
    /**
     * 升级日志
     */
    public function level_log(){
        $this->assign('list', $this->logicLog->getLevelLogList($this->param));
        $this->assign('level', UserLevel::all());
        $this->assign('param',$this->param);
        return $this->fetch();
    }

    /**
     * 信用评级日志
     */
    public function credit_log(){
        $this->assign('list', $this->logicLog->getCreditLogList($this->param));
        $this->assign('level', KingCreditLevel::all());
        $this->assign('param',$this->param);
        return $this->fetch();
    }

    /**
     * otc封禁日志
     */
    public function otc_log(){
        $this->assign('list', $this->logicLog->getOtcLogList($this->param));
        $this->assign('level', [
            [
                'id'=>1,
                'name'=>'OTC限制购买'
            ],
            [
                'id'=>2,
                'name'=>'OTC限制店铺发布'
            ],
            [
                'id'=>3,
                'name'=>'OTC限制店铺匹配'
            ],


        ]);
        $this->assign('param',$this->param);
        return $this->fetch();
    }
    /**
     * 信用评级日志
     */
    public function notice_log(){
        $this->assign('list', $this->logicLog->getUserNoticeList($this->param));
        $this->assign('param',$this->param);
        return $this->fetch();
    }

}
